.messages-container-wrapper {
	position: relative;
}

.message-actions {
	position: absolute;
	z-index: 2;
	top: -28px;
	right: 0.4rem;

	display: none;

	box-sizing: border-box;

	padding: 2px;

	user-select: none;

	color: var(--color-darkest);

	border: 2px solid #f2f3f7;
	border-radius: 4px;

	background: var(rcx-surface, #ffffff);

	font-size: 1.25rem;

	&__buttons {
		display: flex;
	}

	&__button,
	&__menu {
		padding: 2px;

		cursor: pointer;

		&:hover {
			border-radius: 2px;
			background: #eeeff1;
		}

		&-icon {
			fill: currentColor;
		}
	}
}

.rc-ui-kit {
	display: inline-block;

	width: 100%;

	max-width: 400px;
}

.message {
	&:hover,
	&.active {
		background-color: #f7f8fa;

		& .message-actions {
			display: flex;
		}
	}

	& .toggle-hidden {
		display: none;
	}

	&&--ignored {
		min-height: 25px;
		padding: 2px 50px 2px 70px;

		font-size: 12px;

		& > .thumb {
			top: 3px;

			width: 20px;
			height: 20px;
			margin-left: 16px;

			& .avatar {
				width: 100%;
				height: 100%;
			}
		}

		& .user {
			font-size: 0.75rem;
			font-weight: initial;
		}

		& .message-body-wrapper .body,
		& .message-oembed,
		& .attachment,
		& .message-discussion,
		& .message-thread,
		& .reactions,
		& .edited,
		& .role-tag {
			display: none;
		}

		& .toggle-hidden {
			display: block;
		}

		& + .message--ignored.sequential {
			display: none;
		}
	}

	&.active {
		& .message-actions__label {
			color: var(--rc-color-button-primary);
		}
	}

	& .rc-popover-anchor {
		display: block;

		visibility: hidden;

		width: 0;
		height: 0;

		opacity: 0;
	}

	& .rc-popover {
		top: -200vh;
		right: 180px;

		&__wrapper {
			position: fixed;
			top: -100vh;
			left: -100vw;

			width: 300vw;
			height: 300vh;
		}

		&__content {
			position: absolute;
			top: 0;
			left: 0;
		}
	}
}

.message-body {
	&--unstyled {
		vertical-align: bottom;

		font: inherit;
		line-height: initial;

		& .emojione,
		& .emoji {
			display: inline-block !important;

			width: 1em !important;
			min-width: 1em;
			height: 1em !important;
			min-height: 1em;
		}

		& * {
			display: inline !important;

			padding: unset !important;

			vertical-align: unset !important;

			white-space: unset !important;

			color: inherit !important;

			border: unset !important;

			background-color: unset !important;

			font-family: inherit !important;

			font-weight: unset !important;

			line-height: unset !important;

			&::before,
			&::after {
				content: unset !important;
			}
		}

		& a {
			pointer-events: none;
		}
	}
}

.message-oembed {
	overflow: hidden;
}

.messages-box .rc-popover__list {
	padding: 0;
}

.rtl .message-actions {
	right: auto;
	left: 2px;
}

.compact {
	& .message {
		min-height: 26px;
		padding: 5px 15px 5px 37px;

		&.sequential {
			& .thumb:not(.thumb-small),
			& .user {
				display: inline-block;
			}

			& .title {
				position: relative;
				left: 0;

				width: auto;

				text-align: left;
				justify-content: initial;

				& .time,
				& .edited {
					display: inline-block;
				}
			}
		}

		& .attachment {
			& .attachment-title > a {
				font-size: 0.9em;
			}

			& .attachment-author img {
				border-radius: 2px;
			}

			& .inline-image img {
				max-height: 100px;
			}

			& .inline-video {
				max-height: 150px;
			}
		}

		& blockquote iframe {
			width: 266px;
			height: 150px;
		}

		& .message-body-wrapper {
			display: flex;
			align-items: flex-start;
		}

		& .body {
			display: inline;

			max-width: 100%;
			margin-left: 4px;
			padding-right: 48px;

			word-wrap: anywhere;
		}

		& .title {
			& .avatar-image {
				border-radius: 2px;
			}

			& .role-tag {
				display: none;
			}

			& .edited {
				margin-left: 4px;

				& .icon-pencil::before {
					margin-right: 0;
				}
			}
		}

		& .thumb {
			left: 10px;

			width: 20px;
			height: 20px;
			margin-left: 0;

			& .avatar {
				width: 20px;
				height: 20px;
			}
		}
	}
}
